<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Livox SDK API: sdk_core/include/third_party/spdlog/spdlog/sinks/daily_file_sink.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="1.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Livox SDK API
   &#160;<span id="projectnumber">V2.1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('daily__file__sink_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">daily_file_sink.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="daily__file__sink_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">// Copyright(c) 2015 Gabi Melman.</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Distributed under the MIT License (http://opensource.org/licenses/MIT)</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;</div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#ifndef SPDLOG_H</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="spdlog_8h.html">spdlog/spdlog.h</a>&quot;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="file__helper_8h.html">spdlog/details/file_helper.h</a>&quot;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="null__mutex_8h.html">spdlog/details/null_mutex.h</a>&quot;</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="fmt_8h.html">spdlog/fmt/fmt.h</a>&quot;</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="base__sink_8h.html">spdlog/sinks/base_sink.h</a>&quot;</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &lt;chrono&gt;</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &lt;cstdio&gt;</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &lt;ctime&gt;</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &lt;mutex&gt;</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacespdlog.html">spdlog</a> {</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="keyword">namespace </span>sinks {</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment"> * Generator of daily log file names in format basename.YYYY-MM-DD.ext</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="structspdlog_1_1sinks_1_1daily__filename__calculator.html">   29</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structspdlog_1_1sinks_1_1daily__filename__calculator.html">daily_filename_calculator</a></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;{</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    <span class="comment">// Create filename for the form basename.YYYY-MM-DD</span></div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="structspdlog_1_1sinks_1_1daily__filename__calculator.html#ae8461e586d3426987a3b11a00b158db2">   32</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="namespacespdlog.html#acf7ce125b3622e44f8f1702d699e0b06">filename_t</a> <a class="code" href="structspdlog_1_1sinks_1_1daily__filename__calculator.html#ae8461e586d3426987a3b11a00b158db2">calc_filename</a>(<span class="keyword">const</span> <a class="code" href="namespacespdlog.html#acf7ce125b3622e44f8f1702d699e0b06">filename_t</a> &amp;filename, <span class="keyword">const</span> tm &amp;now_tm)</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    {</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;        <a class="code" href="namespacespdlog.html#acf7ce125b3622e44f8f1702d699e0b06">filename_t</a> basename, ext;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;        std::tie(basename, ext) = <a class="code" href="classspdlog_1_1details_1_1file__helper.html#a28d87e3f42c52a12c95af0558aca66f2">details::file_helper::split_by_extension</a>(filename);</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;        std::conditional&lt;std::is_same&lt;filename_t::value_type, char&gt;::value, <a class="code" href="namespacefmt_1_1v5.html#a87104ff0bbd588f55bbbadf592227d75">fmt::memory_buffer</a>, <a class="code" href="classfmt_1_1v5_1_1basic__memory__buffer.html">fmt::wmemory_buffer</a>&gt;<a class="code" href="namespacefmt_1_1v5_1_1internal.html#af8b98afef956b03a99bc61d088705f13">::type</a> w;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;        <a class="code" href="namespacefmt_1_1v5.html#a45ad5d5a47de5513643bf7c75b8d7d91">fmt::format_to</a>(</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;            w, <a class="code" href="os_8h.html#a63d60ea1c1a925d3db13864d37bd2da2">SPDLOG_FILENAME_T</a>(<span class="stringliteral">&quot;{}_{:04d}-{:02d}-{:02d}{}&quot;</span>), basename, now_tm.tm_year + 1900, now_tm.tm_mon + 1, now_tm.tm_mday, ext);</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="namespacefmt_1_1v5.html#af7906102d07e0d93b609aef6c05fc27a">fmt::to_string</a>(w);</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    }</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;};</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="comment"> * Rotating file sink based on date. rotates at midnight</span></div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Mutex, <span class="keyword">typename</span> FileNameCalc = daily_filename_calculator&gt;</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="classspdlog_1_1sinks_1_1daily__file__sink.html">   47</a></span>&#160;<span class="keyword">class </span><a class="code" href="classspdlog_1_1sinks_1_1daily__file__sink.html">daily_file_sink</a> final : <span class="keyword">public</span> <a class="code" href="classspdlog_1_1sinks_1_1base__sink.html">base_sink</a>&lt;Mutex&gt;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;{</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    <span class="comment">// create daily file sink which rotates on given time</span></div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="classspdlog_1_1sinks_1_1daily__file__sink.html#a442164b0813283bc631ad39708fb3669">   51</a></span>&#160;    <a class="code" href="classspdlog_1_1sinks_1_1daily__file__sink.html#a442164b0813283bc631ad39708fb3669">daily_file_sink</a>(<a class="code" href="namespacespdlog.html#acf7ce125b3622e44f8f1702d699e0b06">filename_t</a> base_filename, <span class="keywordtype">int</span> rotation_hour, <span class="keywordtype">int</span> rotation_minute, <span class="keywordtype">bool</span> truncate = <span class="keyword">false</span>)</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        : base_filename_(<a class="code" href="namespacestd.html">std</a>::move(base_filename))</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        , rotation_h_(rotation_hour)</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        , rotation_m_(rotation_minute)</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        , truncate_(truncate)</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    {</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;        <span class="keywordflow">if</span> (rotation_hour &lt; 0 || rotation_hour &gt; 23 || rotation_minute &lt; 0 || rotation_minute &gt; 59)</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        {</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;            <span class="keywordflow">throw</span> <a class="code" href="classspdlog_1_1spdlog__ex.html">spdlog_ex</a>(<span class="stringliteral">&quot;daily_file_sink: Invalid rotation time in ctor&quot;</span>);</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        }</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        <span class="keyword">auto</span> <a class="code" href="namespacespdlog_1_1details_1_1os.html#a0128efefe7b8bbf3b3ba58a1f7a309dd">now</a> = <a class="code" href="namespacespdlog_1_1details_1_1os.html#a0128efefe7b8bbf3b3ba58a1f7a309dd">log_clock::now</a>();</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        file_helper_.open(FileNameCalc::calc_filename(base_filename_, now_tm(<a class="code" href="namespacespdlog_1_1details_1_1os.html#a0128efefe7b8bbf3b3ba58a1f7a309dd">now</a>)), truncate_);</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        rotation_tp_ = next_rotation_tp_();</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    }</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;</div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="classspdlog_1_1sinks_1_1daily__file__sink.html#acc0e22ae2e607dd81223a97936cfc14e">   66</a></span>&#160;    <span class="keyword">const</span> <a class="code" href="namespacespdlog.html#acf7ce125b3622e44f8f1702d699e0b06">filename_t</a> &amp;<a class="code" href="classspdlog_1_1sinks_1_1daily__file__sink.html#acc0e22ae2e607dd81223a97936cfc14e">filename</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="keyword">    </span>{</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        <span class="keywordflow">return</span> file_helper_.filename();</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    }</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="keyword">protected</span>:</div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="classspdlog_1_1sinks_1_1daily__file__sink.html#ac82447cddb7a2ddb45ab81f97b74286d">   72</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classspdlog_1_1sinks_1_1daily__file__sink.html#ac82447cddb7a2ddb45ab81f97b74286d">sink_it_</a>(<span class="keyword">const</span> <a class="code" href="structspdlog_1_1details_1_1log__msg.html">details::log_msg</a> &amp;msg)<span class="keyword"> override</span></div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="keyword">    </span>{</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        <span class="keywordflow">if</span> (msg.<a class="code" href="structspdlog_1_1details_1_1log__msg.html#a25fadb26e6ce94657af5475d4a581313">time</a> &gt;= rotation_tp_)</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        {</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;            file_helper_.open(FileNameCalc::calc_filename(base_filename_, now_tm(msg.<a class="code" href="structspdlog_1_1details_1_1log__msg.html#a25fadb26e6ce94657af5475d4a581313">time</a>)), truncate_);</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;            rotation_tp_ = next_rotation_tp_();</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        }</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        <a class="code" href="classfmt_1_1v5_1_1basic__memory__buffer.html">fmt::memory_buffer</a> formatted;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        <a class="code" href="classspdlog_1_1sinks_1_1sink.html#aa0d19f09363a11b63b4a9b1d46f8a4b3">sink::formatter_</a>-&gt;format(msg, formatted);</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        file_helper_.write(formatted);</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    }</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="classspdlog_1_1sinks_1_1daily__file__sink.html#a37199f25868ac70b91e4f126bcc4b3f8">   85</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classspdlog_1_1sinks_1_1daily__file__sink.html#a37199f25868ac70b91e4f126bcc4b3f8">flush_</a>()<span class="keyword"> override</span></div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="keyword">    </span>{</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        file_helper_.flush();</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    }</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    tm now_tm(log_clock::time_point tp)</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    {</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        time_t tnow = log_clock::to_time_t(tp);</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="namespacespdlog_1_1details_1_1os.html#a9ed2501e3a0bf17176ac848e0a67a148">spdlog::details::os::localtime</a>(tnow);</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    }</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    log_clock::time_point next_rotation_tp_()</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    {</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;        <span class="keyword">auto</span> <a class="code" href="namespacespdlog_1_1details_1_1os.html#a0128efefe7b8bbf3b3ba58a1f7a309dd">now</a> = <a class="code" href="namespacespdlog_1_1details_1_1os.html#a0128efefe7b8bbf3b3ba58a1f7a309dd">log_clock::now</a>();</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;        tm date = now_tm(<a class="code" href="namespacespdlog_1_1details_1_1os.html#a0128efefe7b8bbf3b3ba58a1f7a309dd">now</a>);</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;        date.tm_hour = rotation_h_;</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;        date.tm_min = rotation_m_;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        date.tm_sec = 0;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;        <span class="keyword">auto</span> rotation_time = log_clock::from_time_t(std::mktime(&amp;date));</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        <span class="keywordflow">if</span> (rotation_time &gt; <a class="code" href="namespacespdlog_1_1details_1_1os.html#a0128efefe7b8bbf3b3ba58a1f7a309dd">now</a>)</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        {</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;            <span class="keywordflow">return</span> rotation_time;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;        }</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        <span class="keywordflow">return</span> {rotation_time + std::chrono::hours(24)};</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    }</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    <a class="code" href="namespacespdlog.html#acf7ce125b3622e44f8f1702d699e0b06">filename_t</a> base_filename_;</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <span class="keywordtype">int</span> rotation_h_;</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    <span class="keywordtype">int</span> rotation_m_;</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    log_clock::time_point rotation_tp_;</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    <a class="code" href="classspdlog_1_1details_1_1file__helper.html">details::file_helper</a> file_helper_;</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="keywordtype">bool</span> truncate_;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;};</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div><div class="line"><a name="l00120"></a><span class="lineno"><a class="line" href="namespacespdlog_1_1sinks.html#a61124c3792c83b90aad230770f627525">  120</a></span>&#160;<span class="keyword">using</span> <a class="code" href="classspdlog_1_1sinks_1_1daily__file__sink.html">daily_file_sink_mt</a> = <a class="code" href="classspdlog_1_1sinks_1_1daily__file__sink.html">daily_file_sink&lt;std::mutex&gt;</a>;</div><div class="line"><a name="l00121"></a><span class="lineno"><a class="line" href="namespacespdlog_1_1sinks.html#a1f1c8468d4251073ce96194a5db1fb9e">  121</a></span>&#160;<span class="keyword">using</span> <a class="code" href="classspdlog_1_1sinks_1_1daily__file__sink.html">daily_file_sink_st</a> = <a class="code" href="classspdlog_1_1sinks_1_1daily__file__sink.html">daily_file_sink&lt;details::null_mutex&gt;</a>;</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;} <span class="comment">// namespace sinks</span></div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;<span class="comment">// factory functions</span></div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Factory = default_factory&gt;</div><div class="line"><a name="l00129"></a><span class="lineno"><a class="line" href="namespacespdlog.html#aeab720351e32788bc6cdf8ada42b0f1f">  129</a></span>&#160;<span class="keyword">inline</span> std::shared_ptr&lt;logger&gt; <a class="code" href="namespacespdlog.html#aeab720351e32788bc6cdf8ada42b0f1f">daily_logger_mt</a>(</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <span class="keyword">const</span> std::string &amp;logger_name, <span class="keyword">const</span> <a class="code" href="namespacespdlog.html#acf7ce125b3622e44f8f1702d699e0b06">filename_t</a> &amp;filename, <span class="keywordtype">int</span> hour = 0, <span class="keywordtype">int</span> minute = 0, <span class="keywordtype">bool</span> truncate = <span class="keyword">false</span>)</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;{</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <span class="keywordflow">return</span> Factory::template create&lt;sinks::daily_file_sink_mt&gt;(logger_name, filename, hour, minute, truncate);</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;}</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Factory = default_factory&gt;</div><div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="namespacespdlog.html#a887beb44c55ef32f4bc62fa16451c77e">  136</a></span>&#160;<span class="keyword">inline</span> std::shared_ptr&lt;logger&gt; <a class="code" href="namespacespdlog.html#a887beb44c55ef32f4bc62fa16451c77e">daily_logger_st</a>(</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    <span class="keyword">const</span> std::string &amp;logger_name, <span class="keyword">const</span> <a class="code" href="namespacespdlog.html#acf7ce125b3622e44f8f1702d699e0b06">filename_t</a> &amp;filename, <span class="keywordtype">int</span> hour = 0, <span class="keywordtype">int</span> minute = 0, <span class="keywordtype">bool</span> truncate = <span class="keyword">false</span>)</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;{</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="keywordflow">return</span> Factory::template create&lt;sinks::daily_file_sink_st&gt;(logger_name, filename, hour, minute, truncate);</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;}</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;} <span class="comment">// namespace spdlog</span></div><div class="ttc" id="fmt_8h_html"><div class="ttname"><a href="fmt_8h.html">fmt.h</a></div></div>
<div class="ttc" id="classspdlog_1_1spdlog__ex_html"><div class="ttname"><a href="classspdlog_1_1spdlog__ex.html">spdlog::spdlog_ex</a></div><div class="ttdef"><b>Definition:</b> <a href="common_8h_source.html#l00175">common.h:175</a></div></div>
<div class="ttc" id="namespacespdlog_1_1details_1_1os_html_a0128efefe7b8bbf3b3ba58a1f7a309dd"><div class="ttname"><a href="namespacespdlog_1_1details_1_1os.html#a0128efefe7b8bbf3b3ba58a1f7a309dd">spdlog::details::os::now</a></div><div class="ttdeci">spdlog::log_clock::time_point now() noexcept</div><div class="ttdef"><b>Definition:</b> <a href="os_8h_source.html#l00060">os.h:60</a></div></div>
<div class="ttc" id="classfmt_1_1v5_1_1basic__memory__buffer_html"><div class="ttname"><a href="classfmt_1_1v5_1_1basic__memory__buffer.html">fmt::v5::basic_memory_buffer</a></div><div class="ttdef"><b>Definition:</b> <a href="format_8h_source.html#l00464">format.h:464</a></div></div>
<div class="ttc" id="classspdlog_1_1details_1_1file__helper_html"><div class="ttname"><a href="classspdlog_1_1details_1_1file__helper.html">spdlog::details::file_helper</a></div><div class="ttdef"><b>Definition:</b> <a href="file__helper_8h_source.html#l00025">file_helper.h:25</a></div></div>
<div class="ttc" id="classspdlog_1_1sinks_1_1sink_html_aa0d19f09363a11b63b4a9b1d46f8a4b3"><div class="ttname"><a href="classspdlog_1_1sinks_1_1sink.html#aa0d19f09363a11b63b4a9b1d46f8a4b3">spdlog::sinks::sink::formatter_</a></div><div class="ttdeci">std::unique_ptr&lt; spdlog::formatter &gt; formatter_</div><div class="ttdef"><b>Definition:</b> <a href="sink_8h_source.html#l00050">sink.h:50</a></div></div>
<div class="ttc" id="namespacespdlog_1_1details_1_1os_html_a9ed2501e3a0bf17176ac848e0a67a148"><div class="ttname"><a href="namespacespdlog_1_1details_1_1os.html#a9ed2501e3a0bf17176ac848e0a67a148">spdlog::details::os::localtime</a></div><div class="ttdeci">std::tm localtime(const std::time_t &amp;time_tt) noexcept</div><div class="ttdef"><b>Definition:</b> <a href="os_8h_source.html#l00073">os.h:73</a></div></div>
<div class="ttc" id="namespacestd_html"><div class="ttname"><a href="namespacestd.html">std</a></div><div class="ttdef"><b>Definition:</b> <a href="format_8h_source.html#l00297">format.h:297</a></div></div>
<div class="ttc" id="classspdlog_1_1sinks_1_1daily__file__sink_html"><div class="ttname"><a href="classspdlog_1_1sinks_1_1daily__file__sink.html">spdlog::sinks::daily_file_sink</a></div><div class="ttdef"><b>Definition:</b> <a href="daily__file__sink_8h_source.html#l00047">daily_file_sink.h:47</a></div></div>
<div class="ttc" id="structspdlog_1_1sinks_1_1daily__filename__calculator_html_ae8461e586d3426987a3b11a00b158db2"><div class="ttname"><a href="structspdlog_1_1sinks_1_1daily__filename__calculator.html#ae8461e586d3426987a3b11a00b158db2">spdlog::sinks::daily_filename_calculator::calc_filename</a></div><div class="ttdeci">static filename_t calc_filename(const filename_t &amp;filename, const tm &amp;now_tm)</div><div class="ttdef"><b>Definition:</b> <a href="daily__file__sink_8h_source.html#l00032">daily_file_sink.h:32</a></div></div>
<div class="ttc" id="null__mutex_8h_html"><div class="ttname"><a href="null__mutex_8h.html">null_mutex.h</a></div></div>
<div class="ttc" id="namespacespdlog_html"><div class="ttname"><a href="namespacespdlog.html">spdlog</a></div><div class="ttdef"><b>Definition:</b> <a href="async_8h_source.html#l00027">async.h:27</a></div></div>
<div class="ttc" id="classspdlog_1_1details_1_1file__helper_html_a28d87e3f42c52a12c95af0558aca66f2"><div class="ttname"><a href="classspdlog_1_1details_1_1file__helper.html#a28d87e3f42c52a12c95af0558aca66f2">spdlog::details::file_helper::split_by_extension</a></div><div class="ttdeci">static std::tuple&lt; filename_t, filename_t &gt; split_by_extension(const spdlog::filename_t &amp;fname)</div><div class="ttdef"><b>Definition:</b> <a href="file__helper_8h_source.html#l00125">file_helper.h:125</a></div></div>
<div class="ttc" id="namespacefmt_1_1v5_html_a87104ff0bbd588f55bbbadf592227d75"><div class="ttname"><a href="namespacefmt_1_1v5.html#a87104ff0bbd588f55bbbadf592227d75">fmt::v5::memory_buffer</a></div><div class="ttdeci">basic_memory_buffer&lt; char &gt; memory_buffer</div><div class="ttdef"><b>Definition:</b> <a href="format_8h_source.html#l00553">format.h:553</a></div></div>
<div class="ttc" id="namespacefmt_1_1v5_1_1internal_html_af8b98afef956b03a99bc61d088705f13"><div class="ttname"><a href="namespacefmt_1_1v5_1_1internal.html#af8b98afef956b03a99bc61d088705f13">fmt::v5::internal::type</a></div><div class="ttdeci">type</div><div class="ttdef"><b>Definition:</b> <a href="core_8h_source.html#l00530">core.h:530</a></div></div>
<div class="ttc" id="spdlog_8h_html"><div class="ttname"><a href="spdlog_8h.html">spdlog.h</a></div></div>
<div class="ttc" id="structspdlog_1_1details_1_1log__msg_html"><div class="ttname"><a href="structspdlog_1_1details_1_1log__msg.html">spdlog::details::log_msg</a></div><div class="ttdef"><b>Definition:</b> <a href="log__msg_8h_source.html#l00016">log_msg.h:16</a></div></div>
<div class="ttc" id="classspdlog_1_1sinks_1_1daily__file__sink_html_a37199f25868ac70b91e4f126bcc4b3f8"><div class="ttname"><a href="classspdlog_1_1sinks_1_1daily__file__sink.html#a37199f25868ac70b91e4f126bcc4b3f8">spdlog::sinks::daily_file_sink::flush_</a></div><div class="ttdeci">void flush_() override</div><div class="ttdef"><b>Definition:</b> <a href="daily__file__sink_8h_source.html#l00085">daily_file_sink.h:85</a></div></div>
<div class="ttc" id="namespacespdlog_html_acf7ce125b3622e44f8f1702d699e0b06"><div class="ttname"><a href="namespacespdlog.html#acf7ce125b3622e44f8f1702d699e0b06">spdlog::filename_t</a></div><div class="ttdeci">std::string filename_t</div><div class="ttdef"><b>Definition:</b> <a href="common_8h_source.html#l00205">common.h:205</a></div></div>
<div class="ttc" id="file__helper_8h_html"><div class="ttname"><a href="file__helper_8h.html">file_helper.h</a></div></div>
<div class="ttc" id="base__sink_8h_html"><div class="ttname"><a href="base__sink_8h.html">base_sink.h</a></div></div>
<div class="ttc" id="structspdlog_1_1sinks_1_1daily__filename__calculator_html"><div class="ttname"><a href="structspdlog_1_1sinks_1_1daily__filename__calculator.html">spdlog::sinks::daily_filename_calculator</a></div><div class="ttdef"><b>Definition:</b> <a href="daily__file__sink_8h_source.html#l00029">daily_file_sink.h:29</a></div></div>
<div class="ttc" id="namespacespdlog_html_aeab720351e32788bc6cdf8ada42b0f1f"><div class="ttname"><a href="namespacespdlog.html#aeab720351e32788bc6cdf8ada42b0f1f">spdlog::daily_logger_mt</a></div><div class="ttdeci">std::shared_ptr&lt; logger &gt; daily_logger_mt(const std::string &amp;logger_name, const filename_t &amp;filename, int hour=0, int minute=0, bool truncate=false)</div><div class="ttdef"><b>Definition:</b> <a href="daily__file__sink_8h_source.html#l00129">daily_file_sink.h:129</a></div></div>
<div class="ttc" id="classspdlog_1_1sinks_1_1daily__file__sink_html_acc0e22ae2e607dd81223a97936cfc14e"><div class="ttname"><a href="classspdlog_1_1sinks_1_1daily__file__sink.html#acc0e22ae2e607dd81223a97936cfc14e">spdlog::sinks::daily_file_sink::filename</a></div><div class="ttdeci">const filename_t &amp; filename() const </div><div class="ttdef"><b>Definition:</b> <a href="daily__file__sink_8h_source.html#l00066">daily_file_sink.h:66</a></div></div>
<div class="ttc" id="namespacespdlog_html_a887beb44c55ef32f4bc62fa16451c77e"><div class="ttname"><a href="namespacespdlog.html#a887beb44c55ef32f4bc62fa16451c77e">spdlog::daily_logger_st</a></div><div class="ttdeci">std::shared_ptr&lt; logger &gt; daily_logger_st(const std::string &amp;logger_name, const filename_t &amp;filename, int hour=0, int minute=0, bool truncate=false)</div><div class="ttdef"><b>Definition:</b> <a href="daily__file__sink_8h_source.html#l00136">daily_file_sink.h:136</a></div></div>
<div class="ttc" id="os_8h_html_a63d60ea1c1a925d3db13864d37bd2da2"><div class="ttname"><a href="os_8h.html#a63d60ea1c1a925d3db13864d37bd2da2">SPDLOG_FILENAME_T</a></div><div class="ttdeci">#define SPDLOG_FILENAME_T(s)</div><div class="ttdef"><b>Definition:</b> <a href="os_8h_source.html#l00369">os.h:369</a></div></div>
<div class="ttc" id="classspdlog_1_1sinks_1_1daily__file__sink_html_ac82447cddb7a2ddb45ab81f97b74286d"><div class="ttname"><a href="classspdlog_1_1sinks_1_1daily__file__sink.html#ac82447cddb7a2ddb45ab81f97b74286d">spdlog::sinks::daily_file_sink::sink_it_</a></div><div class="ttdeci">void sink_it_(const details::log_msg &amp;msg) override</div><div class="ttdef"><b>Definition:</b> <a href="daily__file__sink_8h_source.html#l00072">daily_file_sink.h:72</a></div></div>
<div class="ttc" id="namespacefmt_1_1v5_html_a45ad5d5a47de5513643bf7c75b8d7d91"><div class="ttname"><a href="namespacefmt_1_1v5.html#a45ad5d5a47de5513643bf7c75b8d7d91">fmt::v5::format_to</a></div><div class="ttdeci">std::enable_if&lt; is_contiguous&lt; Container &gt;::value &amp;&amp;internal::is_string&lt; S &gt;::value, std::back_insert_iterator&lt; Container &gt; &gt;::type format_to(std::back_insert_iterator&lt; Container &gt; out, const S &amp;format_str, const Args &amp;...args)</div><div class="ttdef"><b>Definition:</b> <a href="core_8h_source.html#l01430">core.h:1430</a></div></div>
<div class="ttc" id="namespacefmt_1_1v5_html_af7906102d07e0d93b609aef6c05fc27a"><div class="ttname"><a href="namespacefmt_1_1v5.html#af7906102d07e0d93b609aef6c05fc27a">fmt::v5::to_string</a></div><div class="ttdeci">std::string to_string(const T &amp;value)</div><div class="ttdef"><b>Definition:</b> <a href="format_8h_source.html#l03209">format.h:3209</a></div></div>
<div class="ttc" id="classspdlog_1_1sinks_1_1daily__file__sink_html_a442164b0813283bc631ad39708fb3669"><div class="ttname"><a href="classspdlog_1_1sinks_1_1daily__file__sink.html#a442164b0813283bc631ad39708fb3669">spdlog::sinks::daily_file_sink::daily_file_sink</a></div><div class="ttdeci">daily_file_sink(filename_t base_filename, int rotation_hour, int rotation_minute, bool truncate=false)</div><div class="ttdef"><b>Definition:</b> <a href="daily__file__sink_8h_source.html#l00051">daily_file_sink.h:51</a></div></div>
<div class="ttc" id="structspdlog_1_1details_1_1log__msg_html_a25fadb26e6ce94657af5475d4a581313"><div class="ttname"><a href="structspdlog_1_1details_1_1log__msg.html#a25fadb26e6ce94657af5475d4a581313">spdlog::details::log_msg::time</a></div><div class="ttdeci">log_clock::time_point time</div><div class="ttdef"><b>Definition:</b> <a href="log__msg_8h_source.html#l00043">log_msg.h:43</a></div></div>
<div class="ttc" id="classspdlog_1_1sinks_1_1base__sink_html"><div class="ttname"><a href="classspdlog_1_1sinks_1_1base__sink.html">spdlog::sinks::base_sink</a></div><div class="ttdef"><b>Definition:</b> <a href="base__sink_8h_source.html#l00022">base_sink.h:22</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_5f1136fe404e0a548faf586fae339a6a.html">sdk_core</a></li><li class="navelem"><a class="el" href="dir_fef6b6f1028f30fedf17225feaaa02fe.html">include</a></li><li class="navelem"><a class="el" href="dir_7bb3e31efd6b819bbb0704cee4a66d41.html">third_party</a></li><li class="navelem"><a class="el" href="dir_cf58c3a45797022668a1e269b5315a33.html">spdlog</a></li><li class="navelem"><a class="el" href="dir_248a80cf6760c7a1ab13394a1c16f7b2.html">spdlog</a></li><li class="navelem"><a class="el" href="dir_92a4bcc0ca1142b221c58a95a60bf3b6.html">sinks</a></li><li class="navelem"><a class="el" href="daily__file__sink_8h.html">daily_file_sink.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
